package 面试;

public class 倒序打印数组 {
    public static void main(String[] args) {
        int arr[]={45,22,33,23,34};
        for (int i = 0; i < arr.length; i++) {
            int num = arr.length - 1 -i;
            switch (num){
                case 0:
                    System.out.print(arr[arr.length - 1 -i]);
                    break;
                default:
                System.out.println(arr[arr.length - 1 -i] + ",");
            }
        }
    }
}
